(function () {
    resize();
    // window.onresize = throttle(resize);

    var docEl = document.documentElement;
        resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize';
    window.addEventListener(resizeEvt, throttle(resize), true);
}())
function throttle(func, delay = 1000) {
    var timer = null;
    return function () {
        var context = this;
        var args = arguments;
        if (!timer) {
            timer = setTimeout(function () {
                func.apply(context, args);
                timer = null;
            }, delay);
        }
    };
}
/** 2022/3/21
*作者:王猛
*功能:获取地址栏参数
*/
function getUrlKey(name) {
    return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ""])[1].replace(/\+/g, '%20')) || null
}
/** 2022/3/21
*作者:王猛
*功能:设置根字体大小
*/
 //large: 18,
 //medium: 16,
 //small: 14,
 //mini: 12,
function resize() {
    var screenWidth = window.screen.width;
    var size = '';
    if(screenWidth>=1600){
        size = '18'
    }else{
        size = '16'
    }
    var fontSize = getUrlKey('fontSize')?getUrlKey('fontSize'):size;
    document.documentElement.style.fontSize = fontSize + 'px';
}
